<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/templateInternet.xhtml">
    
<ui:define name="body">


<a:loadScript src="js/sw-util.js" />
<center>
<h2>#{messages.descricaoConcurso}</h2>
</center>


    <h:form id="PreCadastroCandidatoForm">
        <rich:panel>
            <f:facet name="header">#{messages.fichaPreInscricao}</f:facet>

            <s:decorate id="cargoField" template="/layout/edit.xhtml">
                <ui:define name="label">Cargo</ui:define>
                <h:selectOneMenu value="#{candidato.cargo}" required="true" >
	                 <s:selectItems value="#{cargos}" var="_iten" itemValue="#{_iten}"  label=" #{_iten.codigo} -  #{_iten.nome}"  noSelectionLabel="Selecione um Cargo" hideNoSelectionLabel="false"/>
	                 <a:support event="onchange" action="#{localidadeList.buscar(candidato.cargo)}" reRender="divLocalidade" ajaxSingle="true"/>
	                 <s:convertEntity/>
                </h:selectOneMenu>
            </s:decorate>

			<s:div id="divLocalidade">
	           	<s:decorate id="localidadeField" template="/layout/edit.xhtml" rendered="#{ not empty localidades }">
	                <ui:define name="label">Localidade</ui:define>
	                <h:selectOneMenu value="#{candidato.localidade}" required="true" >
		                <s:selectItems value="#{localidades}" var="_iten" itemValue="#{_iten}"  label=" #{_iten.codigo} -  #{_iten.nome}"  noSelectionLabel="Selecione uma Localidade" hideNoSelectionLabel="false"/>
		                <s:convertEntity/>
	                </h:selectOneMenu>
	            </s:decorate>
			</s:div>
            
            <s:decorate id="nomeField" template="/layout/edit.xhtml">
                <ui:define name="label">Nome</ui:define>
                <h:inputText id="nomeFieldId" required="true" value="#{candidato.nome}" size="70" maxlength="60" >
                	<s:validate />
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="cpfField" template="/layout/edit.xhtml">
                <ui:define name="label">CPF</ui:define>
                <h:inputText id="cpfFieldId" required="true" value="#{candidato.cpf}" size="18" maxlength="14" validator="validaCPF" onkeypress="return SomenteNumero(event,this,'###.###.###-##')" >
                	<s:validate />
                </h:inputText> <h:outputText value="   XXX.XXX.XXX-XX" />
            </s:decorate>

            <s:decorate id="sexoField" template="/layout/edit.xhtml">
                <ui:define name="label">Sexo</ui:define>
                <h:selectOneRadio id="sexoFieldId" value="#{candidato.sexo}" required="true">
                	<f:selectItem itemLabel="Masculino" itemValue="MASCULINO"/>
                	<f:selectItem itemLabel="Feminino"  itemValue="FEMININO"/>
                	<s:validate />
                </h:selectOneRadio>
            </s:decorate>

            <s:decorate id="ufField" template="/layout/edit.xhtml">
                <ui:define name="label">Estado</ui:define>
                <h:selectOneMenu id="ufFieldId" value="#{cidadeList.uf}" required="true">
                	<s:selectItems value="#{ufs}" var="_uf" itemLabel="#{_uf.nome}" itemValue="#{_uf}" label="#{_uf.nome}" hideNoSelectionLabel="false" noSelectionLabel="Selecione"/>
                	<s:convertEntity/>
                	<a:support event="onchange" reRender="cidadeField" ajaxSingle="true" requestDelay="200" action="#{cidadeList.buscaCidade()}"/>
                </h:selectOneMenu>
            </s:decorate>
            
            <s:decorate id="cidadeField" template="/layout/edit.xhtml">
                <ui:define name="label">Cidade</ui:define>
                <h:selectOneMenu id="cidadeFieldId" value="#{candidato.cidade}" required="true" rendered="#{ cidadeList.uf != null }">
                	<s:selectItems value="#{cidades}" var="_cidade" itemLabel="#{_cidade.nome}" itemValue="#{_cidade}" label="#{_cidade.nome}"  />
                	<s:convertEntity/>
                </h:selectOneMenu>
            </s:decorate>

            
            <s:decorate id="enderecoField" template="/layout/edit.xhtml">
                <ui:define name="label">#{messages.endereco}</ui:define>
                <h:inputText id="enderecoFieldId" required="true" value="#{candidato.endereco}" size="70" maxlength="60">
                	<s:validate />
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="bairroField" template="/layout/edit.xhtml">
                <ui:define name="label">Bairro</ui:define>
                <h:inputText id="bairroFieldId" required="true" value="#{candidato.bairro}" size="70" maxlength="60">
                	<s:validate />
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="cepField" template="/layout/edit.xhtml">
                <ui:define name="label">CEP</ui:define>
                <h:inputText id="cepFieldId" required="true" value="#{candidato.cep}" size="12" maxlength="10" validator="validaCEP" onkeypress="return SomenteNumero(event,this,'##.###-###')">
                	<s:validate />
                </h:inputText>  <h:outputText value="   XX.XXX-XXX" />
            </s:decorate>
            
            <s:decorate id="foneField" template="/layout/editFone.xhtml">
                <ui:define name="label">Telefone</ui:define>
                <s:validateAll>
	                <h:inputText id="dddFoneFieldId" required="true" value="#{candidato.dddFone}" size="3" maxlength="2" onkeypress="return SomenteNumero(event)"/>
	                <h:inputText id="foneFieldId"    styleClass="sample4"  required="true" value="#{candidato.fone}" size="11" maxlength="9" validator="validaFone" onkeypress="return SomenteNumero(event,this,'####-####')"/>
	                <h:outputText value="   XX XXXX-XXXX" />
                </s:validateAll>
            </s:decorate>
            
            <s:decorate id="celField" template="/layout/editCelular.xhtml">
                <ui:define name="label">Celular</ui:define>
                <s:validateAll>
	                <h:inputText id="dddCelFieldId" required="false" value="#{candidato.dddCelular}" size="3" maxlength="2" onkeypress="return SomenteNumero(event)"/>
	                <h:inputText id="celFieldId"    required="false" value="#{candidato.celular}"    size="11" maxlength="9" validator="validaFone" onkeypress="return SomenteNumero(event,this,'####-####')" />
	                <h:outputText value="   XX XXXX-XXXX" />
                </s:validateAll>
            </s:decorate>
            
            <s:decorate id="qtFilhosField" template="/layout/edit.xhtml">
                <ui:define name="label">#{messages.numeroDependentes}</ui:define>
                <h:inputText id="qtFilhosFieldId" required="false" value="#{candidato.qtFilho}" size="3" maxlength="2" onkeypress="return SomenteNumero(event)">
                	<s:validate />
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="emailField" template="/layout/edit.xhtml">
                <ui:define name="label">e-mail</ui:define>
                <h:inputText id="emailFieldId" required="false" value="#{candidato.email}" size="70" maxlength="60">
                	<s:validate />
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="dtNascimentoField" template="/layout/edit.xhtml">
                <ui:define name="label">Data nascimento</ui:define>
                <s:validateAll>
	                <h:selectOneMenu value="#{PreCadastroCandidato.diaNascimento}" required="true">
	                	<f:selectItem itemValue="01" itemLabel="01"/>
	                	<f:selectItem itemValue="02" itemLabel="02"/>
	                	<f:selectItem itemValue="03" itemLabel="03"/>
	                	<f:selectItem itemValue="04" itemLabel="04"/>
	                	<f:selectItem itemValue="05" itemLabel="05"/>
	                	<f:selectItem itemValue="06" itemLabel="06"/>
	                	<f:selectItem itemValue="07" itemLabel="07"/>
	                	<f:selectItem itemValue="08" itemLabel="08"/>
	                	<f:selectItem itemValue="09" itemLabel="09"/>
	                	<f:selectItem itemValue="10" itemLabel="10"/>
	                	<f:selectItem itemValue="11" itemLabel="11"/>
	                	<f:selectItem itemValue="12" itemLabel="12"/>
	                	<f:selectItem itemValue="13" itemLabel="13"/>
	                	<f:selectItem itemValue="14" itemLabel="14"/>
	                	<f:selectItem itemValue="15" itemLabel="15"/>
	                	<f:selectItem itemValue="16" itemLabel="16"/>
	                	<f:selectItem itemValue="17" itemLabel="17"/>
	                	<f:selectItem itemValue="18" itemLabel="18"/>
	                	<f:selectItem itemValue="19" itemLabel="19"/>
	                	<f:selectItem itemValue="20" itemLabel="20"/>
	                	<f:selectItem itemValue="21" itemLabel="21"/>
	                	<f:selectItem itemValue="22" itemLabel="22"/>
	                	<f:selectItem itemValue="23" itemLabel="23"/>
	                	<f:selectItem itemValue="24" itemLabel="24"/>
	                	<f:selectItem itemValue="25" itemLabel="25"/>
	                	<f:selectItem itemValue="26" itemLabel="26"/>
	                	<f:selectItem itemValue="27" itemLabel="27"/>
	                	<f:selectItem itemValue="28" itemLabel="28"/>
	                	<f:selectItem itemValue="29" itemLabel="29"/>
	                	<f:selectItem itemValue="30" itemLabel="30"/>
	                	<f:selectItem itemValue="31" itemLabel="31"/>
	                </h:selectOneMenu>
	                <h:selectOneMenu value="#{PreCadastroCandidato.mesNascimento}" required="true">
	                	<f:selectItem itemValue="0" itemLabel="Janeiro" />
	                	<f:selectItem itemValue="1" itemLabel="Fevereiro" />
	                	<f:selectItem itemValue="2" itemLabel="Marco" />
	                	<f:selectItem itemValue="3" itemLabel="Abril" />
	                	<f:selectItem itemValue="4" itemLabel="Maio" />
	                	<f:selectItem itemValue="5" itemLabel="Junho" />
	                	<f:selectItem itemValue="6" itemLabel="Julho" />
	                	<f:selectItem itemValue="7" itemLabel="Agosto" />
	                	<f:selectItem itemValue="8" itemLabel="Setembro" />
	                	<f:selectItem itemValue="9" itemLabel="Outubro" />
	                	<f:selectItem itemValue="10" itemLabel="Novembro" />
	                	<f:selectItem itemValue="11" itemLabel="Dezembro" />
	                </h:selectOneMenu>
	                <h:selectOneMenu value="#{PreCadastroCandidato.anoNascimento}" required="true">
						<f:selectItem itemValue="1931"/>
						<f:selectItem itemValue="1932"/>
						<f:selectItem itemValue="1933"/>
						<f:selectItem itemValue="1934"/>
						<f:selectItem itemValue="1935"/>
						<f:selectItem itemValue="1936"/>
						<f:selectItem itemValue="1937"/>
						<f:selectItem itemValue="1938"/>
						<f:selectItem itemValue="1939"/>
						<f:selectItem itemValue="1940"/>
						<f:selectItem itemValue="1941"/>
						<f:selectItem itemValue="1942"/>
						<f:selectItem itemValue="1943"/>
						<f:selectItem itemValue="1944"/>
						<f:selectItem itemValue="1945"/>
						<f:selectItem itemValue="1946"/>
						<f:selectItem itemValue="1947"/>
						<f:selectItem itemValue="1948"/>
						<f:selectItem itemValue="1949"/>
						<f:selectItem itemValue="1950"/>
						<f:selectItem itemValue="1951"/>
						<f:selectItem itemValue="1952"/>
						<f:selectItem itemValue="1953"/>
						<f:selectItem itemValue="1954"/>
						<f:selectItem itemValue="1955"/>
						<f:selectItem itemValue="1956"/>
						<f:selectItem itemValue="1957"/>
						<f:selectItem itemValue="1958"/>
						<f:selectItem itemValue="1959"/>
						<f:selectItem itemValue="1960"/>
						<f:selectItem itemValue="1961"/>
						<f:selectItem itemValue="1962"/>
						<f:selectItem itemValue="1963"/>
						<f:selectItem itemValue="1964"/>
						<f:selectItem itemValue="1965"/>
						<f:selectItem itemValue="1966"/>
						<f:selectItem itemValue="1967"/>
						<f:selectItem itemValue="1968"/>
						<f:selectItem itemValue="1969"/>
						<f:selectItem itemValue="1970"/>
						<f:selectItem itemValue="1971"/>
						<f:selectItem itemValue="1972"/>
						<f:selectItem itemValue="1973"/>
						<f:selectItem itemValue="1974"/>
						<f:selectItem itemValue="1975"/>
						<f:selectItem itemValue="1976"/>
						<f:selectItem itemValue="1977"/>
						<f:selectItem itemValue="1978"/>
						<f:selectItem itemValue="1979"/>
						<f:selectItem itemValue="1980"/>
						<f:selectItem itemValue="1981"/>
						<f:selectItem itemValue="1982"/>
						<f:selectItem itemValue="1983"/>
						<f:selectItem itemValue="1984"/>
						<f:selectItem itemValue="1985"/>
						<f:selectItem itemValue="1986"/>
						<f:selectItem itemValue="1987"/>
						<f:selectItem itemValue="1988"/>
						<f:selectItem itemValue="1989"/>
						<f:selectItem itemValue="1990"/>
						<f:selectItem itemValue="1991"/>
						<f:selectItem itemValue="1992"/>
						<f:selectItem itemValue="1993"/>
						<f:selectItem itemValue="1994"/>
						<f:selectItem itemValue="1995"/>
						<f:selectItem itemValue="1996"/>
	                </h:selectOneMenu>
                
                </s:validateAll>
            </s:decorate>
            
            <s:decorate id="rgField" template="/layout/edit.xhtml">
                <ui:define name="label">Registro Geral No</ui:define>
                <h:inputText id="rgFieldId" required="true" value="#{candidato.rg}" size="70" maxlength="60">
                	<s:validate />
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="estadoCivilField" template="/layout/edit.xhtml">
                <ui:define name="label">Estado civil</ui:define>
                <h:selectOneMenu value="#{candidato.estadoCivil}" required="true">
                	<f:selectItem itemLabel="Solteiro"   itemValue="SOLTEIRO"/>
                	<f:selectItem itemLabel="Casado"     itemValue="CASADO"/>
                	<f:selectItem itemLabel="Separado"   itemValue="SEPARADO"/>
                	<f:selectItem itemLabel="Divorciado" itemValue="DIVORCIADO" />
                	<f:selectItem itemLabel="Viuvo"      itemValue="VIUVO"/>
                	<s:validate />
                </h:selectOneMenu>
            </s:decorate>
            
            <s:decorate id="canhotoField" template="/layout/edit.xhtml">
                <ui:define name="label">Canhoto ?</ui:define>
                <h:selectOneRadio id="canhotoFieldId" value="#{candidato.canhoto}" required="true">
                	<f:selectItem itemLabel="Nao" itemValue="DESTRO"/>
                	<f:selectItem itemLabel="Sim" itemValue="CANHOTO"/>
                	<s:validate />
                </h:selectOneRadio>
            </s:decorate>



			<s:div id="divObs">
	            <s:decorate id="obsField" template="/layout/edit.xhtml">
	            	<ui:define name="label">#{messages.observacoes}</ui:define>
	            	<li>Recursos e/ou aparatos especiais de que necessita para realizar as provas:</li>
	            	<h:selectBooleanCheckbox value="#{candidato.cadeirante}"  /> Cadeirante (sala especial)<br/>
	            	<h:selectBooleanCheckbox value="#{candidato.visualBraile}"  /> Deficiente visual (prova em braile)<br/>
	            	<h:selectBooleanCheckbox value="#{candidato.visualLeitor}" /> Deficiente visual (prova com leitor)<br/>
	            	<h:selectBooleanCheckbox value="#{candidato.gestante}" /> Gestante em proximidade de parto<br/>
	            	<h:selectBooleanCheckbox value="#{candidato.lactante}" /> Lactante<br/>
					Outro: Especificar a necessidade.<br/>
	                <h:inputTextarea id="obsFieldId" required="false" value="#{candidato.obs}" rows="10" cols="70" maxlength="200" >
	                	<s:validate />
	                </h:inputTextarea>
	            </s:decorate>
			</s:div>

            
            <div style="clear:both"/>

        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="preCadastroCandidato" value="#{messages.btPreinscricao}"
                    action="#{PreCadastroCandidato.preCadastroCandidato}">
                    <f:param name="idConcurso" value="#{PreCadastroCandidato.idConcurso}" />
             </h:commandButton>
        </div>


		    <rich:panel >
               <br />
				#{messages.infoEditalFicha}     

		    </rich:panel>      
		    
    </h:form>

</ui:define>

</ui:composition>
